1. Field of the Invention
The present invention relates to an engine control system for controlling vehicle-mounted engines.
2. Related Art
Vehicle-mounted engines are controlled by electronic control units including programmed microcomputers. Control programs of the microcomputer generally comprise a rotation-synchronized interrupt routine (NE task) executed every predetermined angular rotation (30.degree. CA) of an engine crankshaft, a plurality of time-synchronized interrupt routines (time tasks) executed every respective predetermined time intervals, and a base routine executed while the above interrupt routines are not being executed. Those routines have different execution priorities. That is, the rotation interrupt routine has the highest priority. The time interrupt routines have different priorities lower than that of the rotation interrupt routine, the different priorities being increased as the predetermined time intervals of interrupts are shorter.
Specifically, the microcomputer executes its NE task and time tasks 1 and 2 as shown in FIGS. 8A and 8B. In the figures, a period of executing the task is indicated with a crossed rectangle mark, and a period of waiting because of execution of another task of higher priority is indicated with a non-crossed rectangle mark.
For instance, in FIG. 8A, it is assumed that the time task 1 which is to be executed every 4 ms is executed from time t1 under the condition that the engine rotation speed NE is in the normal range (about 2,000 rpm). When an interrupt of the NE task having the priority higher than the time task 1 arises at time t2, the time task 1 being executed is interrupted and the execution of the NE task starts. When the execution of the NE task ends at time t3, the execution of the time task 1 is resumed to complete its remaining processing. The time task 2 which is to be executed every 16 ms is interrupted for a longer period by both NE task and time task 1, because its priority is lower than the NE task and time task 1.
If the engine rotation speed NE is in the high speed range (about 6,000 rpm), the NE task is initiated every 0.8 ms as opposed to every 2.4 ms (about 2,000 rpm). Thus, as shown in FIG. 8B, the NE task is initiated more frequently, and the time tasks 1 and 2 are interrupted more frequently.
The time task 1 is designed to share a part of engine control processing, such as calculation processing related to fuel injection and ignition, which is more influential on the engine operation than the control processing shared by the time task 2. This is for the reason that the more influential calculation processing should be executed more quickly and frequently for improving control accuracy. Thus, it is likely that that the engine control accuracy cannot be improved so much as the engine rotation speed rises.
It may be possible to reduce the number of processing executed in the NE task as the engine rotation speed rises, lessening the control accuracy in the high engine speed range. However, there are many cases in which the same level of control accuracy should be maintained. For instance, in an ignition misfire detection such as disclosed in U.S. Pat. No. 5,222,392 (JP-A-5-33717), the engine rotation speed should be calculated in the NE task every predetermined angular rotation of the crankshaft for use in the misfire detection. If the misfire detection is executed in the NE task together with the engine speed calculation, the execution period of the NE task becomes longer and the time task 1 is interrupted for a longer peirod as shown in FIG. 8B.